<template>
	<view class="container-detail">
		<view class="detail-top">
			<view class="backIcon" @click="back">
				<uni-icons type="left" size="30"></uni-icons>
			</view>
			<view class="langText">
				{{title}}
			</view>
			<view class="clearView">
				
			</view>
		</view>
		<view class="act-view">
			<view class="detail-view">
				<p class="act-title">{{title}}</p>
				<p class="act-time">{{create_at}}</p>
			</view>
			<view class="act-content">
				<rich-text :nodes="content"></rich-text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title:'',
				time:"",
				content:"",
				create_at:'',
				id:0,
			}
		},
		onLoad(option) {
			this.id = option.id
			this.getindex()
		},
		methods: {
			getindex(){
				this.$http.get(
					'api/hd/details',//接口名
					{id:this.id},//参数合集
				).then(res=>{
					this.title = res.data.data.title
					this.create_at = res.data.data.create_at
					this.conetnt = res.data.data.conetnt
					// console.log(this.datas)
				},(err)=>{//失败的操作
					uni.showToast({
						icon: 'error',
						title: err.data.message
					});
				})
			},
			back(){
				uni.navigateBack({
					delta:1,//返回层数，2则上上页
				})
			},
		}
	}
</script>

<style>
	.container-detail {
		background-color: #f6f6f6;
	}
	.detail-top{
		display: flex;
		padding: 0 0 0 16rpx;
		height:88rpx;
		line-height:88rpx;
		background-color: #fff;
	}
	.backIcon{}
	.langText{
		font-size:36rpx;
		margin-left:12rpx;
	}
	.clearView{}
	.act-view{
		background: #fff;
		font-size: 26rpx;
		color: rgba(0, 0, 0, .6);
		padding: 32rpx 24rpx;
		background: #fff;
		box-shadow: 0 2px 9px 2px hsla(0,0%,62.7%,.15);
		margin-top:12rpx;
	}
	.detail-view{
		display: flex;
	}
	.act-title{
		width:60%;
		text-align:left;
		font-size: 28rpx;
		font-weight: 700;
	}
	.act-time{
		width:40%;
		text-align:right;
		font-size: 24rpx;
		color: rgba(0, 0, 0, .6);
	}
	.act-content{
		margin-top:30rpx;
		font-size: 24rpx;
	}
</style>
